package org.zoomdev.zoom.aop.modules;

import org.zoomdev.zoom.aop.utils.AopUtils;

import java.lang.reflect.Method;

public final class MethodWithTypeConfig {

    public final Method method;
    public final String desc;
    //实际是哪个
    private String type;

    //实际加载类
    private Class realType;

    private Class enhancedType;

    public MethodWithTypeConfig(String desc, Method method) {
        this.desc = desc;
        this.method = method;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getReplaceType() {
        if(enhancedType!=null){
            return AopUtils.getEnhancedClassName(this.type);
        }
        return this.type;
    }

    public Class getRealType() {
        return realType;
    }

    public void setRealType(Class realType) {
        this.realType = realType;
    }

    public Class getEnhancedType() {
        return enhancedType;
    }

    public void setEnhancedType(Class enhancedType) {
        this.enhancedType = enhancedType;
    }
}
